#pragma once
#include "C_Widget.h"

namespace gui {
	class C_Label :
		public C_Widget
	{
	private:
		std::wstring	m_text;
		sf::Text		m_drawText;
	public:
		C_Label(C_Widget* parent = NULL);
		virtual ~C_Label();

		/////////////////////////////////////////////////////////////////////////////////////////
		////////////////	SET / GET COLOR
		inline void			setColorText(sf::Uint8 r, sf::Uint8 g, sf::Uint8 b, sf::Uint8 a = 255) 
										   { m_drawText.setColor(sf::Color(r, g, b, a)); }
		inline void			setColorText(sf::Color c) 
										   { m_drawText.setColor(c); }
		inline sf::Color	getColorText() { return m_drawText.getColor(); }

		/////////////////////////////////////////////////////////////////////////////////////////
		////////////////	SET / GET TEXT
		void			setText(std::wstring text)	
		{ 
			m_text = text; 
			m_drawText.setString(text); 
			this->setSize(m_drawText.getGlobalBounds().width, m_drawText.getCharacterSize());
		}
		std::wstring		text()						{ return m_text; }

		/////////////////////////////////////////////////////////////////////////////////////////
		////////////////	SET / GET CHARACTER SIZE
		void			setTextSize(UINT32 size)	
		{ 
			m_drawText.setCharacterSize(size); 
			this->setSize(m_drawText.getGlobalBounds().width, m_drawText.getCharacterSize());
		}
		UINT32			textSize() { return m_drawText.getCharacterSize(); }

		/////////////////////////////////////////////////////////////////////////////////
		/////////////////	VIRTUAL FUNCTION
		virtual void renderWidget();
		virtual void syncWidgets();
	};
}

